package com.house.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.*;
import java.util.List;

/**
 * @author: GGP
 * @description: 房源DTO实体类
 * @time: 2023-04-13 11:26
 **/

@ApiModel(description = "房源请求实体类",value = "HouseDTO")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
public class HouseDTO {

	/** 房屋标题 */
	@ApiModelProperty(name = "houseTitle",value = "房屋标题",required = true,example = "豪华名宿，便宜入住！")
	@NotBlank(message = "房屋标题不能为空")
	@Size(max = 20,message = "房屋标题长度不能超过20")
	private String houseTitle;

	/** 房屋规格（几室几厅） */
	@ApiModelProperty(name = "houseModel",value = "房屋规格（几室几厅）",required = true,example = "三室一厅")
	@NotBlank(message = "房屋规格不能为空")
	@Size(max = 20,message = "房屋规格长度不能超过20")
	private String houseModel;

	/** 房屋简介 */
	@ApiModelProperty(name = "houseDesc",value = "房屋简介",required = true,example = "交通便捷，离商场近")
	@NotBlank(message = "房屋简介不能为空")
	@Size(max = 200,message = "房屋简介长度不能超过200")
	private String houseDesc;

	/** 房屋面积 */
	@ApiModelProperty(name = "houseArea",value = "房屋面积",required = true,example = "142")
	@Max(value = 99999,message = "房屋面积设置异常")
	private Integer houseArea;

	/** 房屋总楼层 */
	@ApiModelProperty(name = "houseFloor",value = "房屋总楼层",required = true,example = "3")
	@Max(value = 999,message = "房屋总楼层设置异常")
	private Integer houseFloor;

	/** 装修风格 */
	@ApiModelProperty(name = "houseStyle",value = "装修风格",required = true,example = "普通装修")
	@NotBlank(message = "装修风格不能为空")
	@Size(max = 20,message = "装修风格长度不能超过20")
	private String houseStyle;

	/** 出租方式 */
	@ApiModelProperty(name = "houseType",value = "出租方式",required = true,example = "合租")
	@NotBlank(message = "出租方式不能为空")
	@Size(max = 20,message = "出租方式长度不能超过20")
	private String houseType;

	/** 所在城市 */
	@ApiModelProperty(name = "houseCity",value = "所在城市id",required = true,example = "1")
	@NotNull(message = "所在城市不能为空")
	private Integer houseCity;

	/** 房屋详细地址 */
	@ApiModelProperty(name = "houseAddress",value = "房屋详细地址",required = true,example = "金堂县")
	@NotBlank(message = "详细地址不能为空")
	@Size(max = 100,message = "详细地址长度不能超过100")
	private String houseAddress;

	/** 小区名称 */
	@ApiModelProperty(name = "communityName",value = "小区名称",required = true,example = "长江花园")
	@NotBlank(message = "小区名称不能为空")
	@Size(max = 50,message = "详细地址长度不能超过50")
	private String communityName;

	/** 价格 */
	@ApiModelProperty(name = "price",value = "价格",required = true,example = "179")
	@NotNull(message = "价格不能为空")
	@Max(value = 999999,message = "价格设置异常")
	private Integer price;

	/** 房屋朝向 */
	@ApiModelProperty(name = "houseOriented",value = "房屋朝向",required = true,example = "西南")
	@NotBlank(message = "房屋朝向不能为空")
	@Size(max = 20,message = "房屋朝向长度不能超过20")
	private String houseOriented;

	/** 房东联系方式 */
	@ApiModelProperty(name = "publisherPhone",value = "房东联系方式",required = true,example = "17643234432")
	@NotBlank(message = "房东联系方式不能为空")
	@Pattern(regexp = "\\d{11}",message = "手机号格式不正确")
	private String publisherPhone;

	/** 房东 */
	@ApiModelProperty(name = "publisher",value = "房东id",required = true,example = "1")
	@NotNull(message = "房东id不能为空")
	private Integer publisherId;

	/** 房屋简介照片 */
	@ApiModelProperty(name = "houseImage",value = "房屋简介照片",required = true,example = "http://localhost:8080/img/61c98db2-2ae7-4d91-88aa-65b3083a7709.jfif")
	@NotBlank(message = "简介照片不能为空")
	private String houseImage;

	/** 房屋详情照片 */
	@ApiModelProperty(name = "imgs",value = "房屋详情照片",required = true,example = "[\n" +
			"        \"http://localhost:8080/img/9e2a8ead-fd6c-43cc-adab-2c1528e9b1de.jfif\",\n" +
			"        \"http://localhost:8080/img/e62deb70-096c-4656-8ce9-d955d13755a0.jfif\",\n" +
			"        \"http://localhost:8080/img/7d195c50-453f-44f7-acea-8741ed463ca4.jfif\"\n" +
			"    ]")
	@NotNull(message = "详情照片不能为空")
	private List<String> imgs;

	/** 最小面积 */
	@ApiModelProperty(name = "lowArea",value = "最小面积",example = "130")
	private Integer lowArea;

	/** 最大面积 */
	@ApiModelProperty(name = "higArea",value = "最大面积",example = "160")
	private Integer higArea;

	/** 最低价 */
	@ApiModelProperty(name = "lowPrice",value = "最低价",example = "150")
	private Integer lowPrice;

	/** 最高价 */
	@ApiModelProperty(name = "higPrice",value = "最高价",example = "200")
	private Integer higPrice;

	/** 页码 */
	@ApiModelProperty(name = "page",value = "页码",required = true,example = "1")
	private Integer page;

	/** 每页大小 */
	@ApiModelProperty(name = "size",value = "每页大小",required = true,example = "10")
	private Integer size;
}
